Package com.cisco.pt.ptmp
Interface PacketTracerSession
- All Known Implementing Classes:
MUSessionImpl,PacketTracerSessionImpl
public interface PacketTracerSession
- Author:
- packettracerexapps@external.cisco.com
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Terminate this session; close connection and release resourcesReturns the keepalive task handler.Returns the notifier object if any.This function returns the status of the session.Returns the notifier object if any.voidhandleEvent(LTV event) Handles an IPC event that was read off the pipelinevoidhandleKeepAlive(LTV msg) Handler for receiving KeepAliveLTVs.voidPasses non return value LTVs to the LTVNotifier if it exists.voidhandleMuMessage(LTV msg) Handles Multiuser messagesvoidNotifies the keepalive notifier object of a timeoutbooleanA convenience method to test if the underlying connection is connectedbooleanThis function will return getSessionStatus() == STATUS_IPC_READY.booleanThis function will return getSessionStatus() == STATUS_MU_READY.booleanpipeline()booleanError handler for Packet Tracer Read Worker thread.voidRegisters your LTVNotifier object with this session.voidRegisters your KeepAliveExpireNotifier object with this session.timer()voidPasses off the tlv to the pipeline and does not wait for a responsePasses off the tlv to the pipeline and waits for a response
-
Method Details
-
isShutdown
boolean isShutdown() -
getEventManager
IPCEventManager getEventManager()- Returns:
- IPCEventManager the session's event manager
-
connection
PacketTracerConnection connection()- Returns:
- PacketTracerConnection the underlying PT connection
-
pipeline
Pipeline pipeline()- Returns:
- Pipeline the data pipeline and associated filters
-
timer
Timer timer()- Returns:
- Timer the keepalive timer
-
isConnected
boolean isConnected()A convenience method to test if the underlying connection is connected- Returns:
- boolean is pt connected
-
close
Terminate this session; close connection and release resources- Throws:
IOException- problem with connection
-
write
Passes off the tlv to the pipeline and does not wait for a response- Parameters:
tlv- - the tlv to write- Throws:
IOException- problem with connection
-
writeRead
Passes off the tlv to the pipeline and waits for a response- Parameters:
tlv- - the tlv to write- Returns:
- the tlv returned from PT
- Throws:
IOException- problem with connection
-
handleEvent
Handles an IPC event that was read off the pipeline- Parameters:
event- The event LTV
-
handleMuMessage
Handles Multiuser messages- Parameters:
msg- The mu message
-
readWorkerError
Error handler for Packet Tracer Read Worker thread. Thrown when too many errors accumulate- Parameters:
t- The thrown object.- Returns:
- boolean whether it was properly handled
-
getKeepAliveTask
KeepAliveTask getKeepAliveTask()Returns the keepalive task handler.- Returns:
- KeepAliveTask The keepalive task handler.
-
handleKeepAlive
Handler for receiving KeepAliveLTVs. Refreshes the counter.- Parameters:
msg- LTV
-
handleLTV
Passes non return value LTVs to the LTVNotifier if it exists.- Parameters:
msg- The KeepAliveLTV object.
-
setNotifier
Registers your LTVNotifier object with this session.- Parameters:
n- The LTVNotifier object.
-
getNotifier
LTVNotifier getNotifier()Returns the notifier object if any.- Returns:
- LTVNotifier the registered notifier object
-
isIpcReady
boolean isIpcReady()This function will return getSessionStatus() == STATUS_IPC_READY.- Returns:
- boolean Boolean value of whether the IPC is ready to accept messages.
-
isMuReady
boolean isMuReady()This function will return getSessionStatus() == STATUS_MU_READY.- Returns:
- boolean Boolean value of whether the Multiuser connection is ready to accept messages.
-
getSessionStatus
Object getSessionStatus()This function returns the status of the session.- Returns:
- Object The session status object.
-
handleTimeout
void handleTimeout()Notifies the keepalive notifier object of a timeout -
setTimeoutNotifier
Registers your KeepAliveExpireNotifier object with this session.- Parameters:
n- The KeepAliveExpireNotifier object.
-
getTimeoutNotifier
KeepAliveExpireNotifier getTimeoutNotifier()Returns the notifier object if any.- Returns:
- KeepAliveExpireNotifier the registered notifier object
-